package com.mall.model.dto;

import lombok.Data;
import lombok.ToString;

import javax.validation.constraints.Max;
import javax.validation.constraints.Min;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
@Data
@ToString
public class AddProductRequest {
    @NotBlank(message = "商品名称不能为null")
    private String name;
    @NotNull(message = "类别id不能为null")
    private Integer categoryId;
    @NotNull(message = "价格不能为null")
    @Min(value = 1,message = "价格不能低于1分")
    private Integer price;
    @NotNull(message = "库存不能为null")
    @Max(value = 1000,message ="库存最大不能超过1000")
    @Min(value = 10,message = "库存最小为10")
    private Integer stock;
    private String detail;
    @NotBlank(message =  "图片路径不能为空")
    private String image;
}
